<?php  
?>
<h2><?php echo "Surveys Summary"; ?><hr/></h2>
<form id="frmCancelLeave" name="frmCancelLeave" method="post" action="">
<table border="0" cellpadding="0" cellspacing="0">
  <thead>
  	<tr>
		<th class="tableTopLeft"></th>
    	<th class="tableTopMiddle" width="500"></th>            	
		<th class="tableTopRight"></th>
	</tr>
  </thead>
  <tbody>
<?php
	$j = 0;
	if (is_array($records) && count($records)>0) {		
		foreach ($records as $record) {
			//$surveyOwner = 
			if(!($j%2)) {
				$cssClass = 'odd';
			 } else {
			 	$cssClass = 'even';
			 }
			 $j++;
			 
			 $answers = Answers::getAnswersBySurveyUser($record->getId(),$_SESSION['empID']);
    		if(count($answers)==0 || $record->getSurveyType()==2){

?>
  <tr>
  	<td class="tableMiddleLeft"></td>
    <td class="<?php echo $cssClass; ?>">
    	<?php 
    		
    	 ?>
    	<a href="CentralController.php?surveycode=Surveys&action=StartSurvey&id=<?php echo $record->getId(); ?>" target="rightMenu"><?php echo $record->getSurveyName(); ?></a></td>    
	<td class="tableMiddleRight"></td>
  </tr>

<?php
    		}
		}
	}else{ ?>
		<tr>
	  	<td class="tableMiddleLeft"></td>
	    <td class="">No survey avaible now</td>    
		<td class="tableMiddleRight"></td>
  </tr>
		
	<?php }
?>
  </tbody>
  <tfoot>
  	<tr>
		<td class="tableBottomLeft"></td>
		<td class="tableBottomMiddle"></td>				
		<td class="tableBottomRight"></td>
	</tr>
  </tfoot>
</table>

